// import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// import axios from 'axios'
import infiniteScroll from 'vue-infinite-scroll'
// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
import Bridge from '@/components/dsbridge.js'



import VuCountryIntl from 'vue-country-tel';
// 引入css
import 'vue-country-tel/lib/vue-country-intl.css'
// 全局注册组件
Vue.component(VuCountryIntl.name, VuCountryIntl);

Vue.prototype.$dsbridge = Bridge
// Vue.use(ElementUI);
Vue.use(infiniteScroll)

// Vue.prototype.$url='http://192.168.10.32:18090'//本地测试地址
Vue.prototype.$url='https://api.lianpucom.com'//生产地址
Vue.config.productionTip = false
Vue.prototype.$axios = axios.create({
  // 去掉域名前缀
  baseURL: 'https://api.lianpucom.com',
  // baseURL: 'http://192.168.10.32:18090',
  // 其他配置...
});
// Vue.prototype.$token = localStorage.getItem("token");




Vue.prototype.$axios.interceptors.request.use(function (config) {
  // 在发送请求之前做些什么
  // config.headers.Authorization = 'igwYGKmDStvxaQZ/c13GcjTXbCHNsRhzc3g3f9qMFyvkwuoNO6FblGpOcFqHlETuwJg4W/1IaEvEGzV2DBK6OP2q4vYmLX9rDSyu2vgXyIA='
  config.headers.Authorization = localStorage.getItem("token")
  return config;
}, function (error) {
  // 对请求错误做些什么
  console.log(error)
  // config.headers.Authorization = localStorage.getItem("token")
  // return Promise.reject(error);
});

new Vue({
  router,
  store,
  render: function (h) { return h(App) }
}).$mount('#app')
